//
//  MainCollectionViewCell.m
//  Ting
//
//  Created by 安静的美男子 on 14/11/12.
//  Copyright (c) 2014年 安静的美男子. All rights reserved.
//

#import "MainCollectionViewCell.h"
#import "UIImageView+WebCache.h"


@implementation MainCollectionViewCell




-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
         self.button = [[UIImageView alloc]init];
    }
    return self;
}



-(void)setArray:(NSMutableArray *)arr indexpath:(NSInteger)indexpath flag:(BOOL)flag
{
    
    
        self.button.userInteractionEnabled = NO;
    self.button.backgroundColor = [UIColor clearColor];
    
        self.button.frame = self.contentView.bounds;
    if (flag == NO) {
        if (indexpath == 7)
        {
            self.button.image =[UIImage imageNamed:@"findCategory_arrow_down@2x.png"];
                                
        
        }
        else
        {

            [self.button setImage:[UIImage imageNamed:[NSString stringWithFormat:@"find_%@.png",[arr[indexpath] objectForKey:@"name"]]]];
            
            
            
//            [self.button sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[arr[indexpath] objectForKey:@"coverPath"]]]];
        }
    }else{
       if (indexpath == 19)
    {
        
         self.button.image =[UIImage imageNamed:@"findCategory_arrow_up@2x.png"];
        
    }
    else
    {
         [self.button setImage:[UIImage imageNamed:[NSString stringWithFormat:@"find_%@.png",[arr[indexpath] objectForKey:@"name"]]]];
//        [self.button sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[arr[indexpath] objectForKey:@"coverPath"]]]];  //placeholderImage:[UIImage imageNamed:@"123.gif"]];
    }
    }
    [self.contentView addSubview:_button];
}
@end
